Some of my users are encountering a "Failed to fetch" issue on certain fetch requests. I'm trying to figure out why. It's fetching from the same domain, so it shouldn't be a CORS issue.
Is there any way I can get more info? e.g. in Chrome, when I intentionally block the URL, it tells me blocked:devtools. Can I get similar info out of the error object in a .catch block? e.g. bad headers, CORS rejection, lost internet, whatever?
To be clear, I want to get this info programmatically. My users are experiencing this issue, not me. I'll send the data to my error catcher to debug further.
PerformanceObserver does not seem to report on requests that have failed:
(async () => {
const o = new PerformanceObserver((list, observer) => {
console.log('observation!')
console.log(list.getEntries())
})
o.observe({entryTypes:['resource']})
fetch('/fail').then(console.info,console.error)
o.disconnect()
})()